package com.example.springcloud.alibaba.controller;

import com.example.springcloud.alibaba.model.Order;
import com.example.springcloud.alibaba.service.OrderService;
import com.example.springcloud.entities.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

@RestController
public class OrderController {
    @Resource
    private OrderService orderService;
    @GetMapping(value = "/order/create")
    public CommonResult create(Long userId,Long productId) {
        Order order = new Order();
        order.setUserId(userId).setProductId(productId);
        orderService.create(order);
        return new CommonResult(200,"订单创建成功");
    }
}
